package com.sixth.controller;

import com.sixth.bean.MarketUser;
import com.sixth.bean.common.BaseRespVo;
import com.sixth.bean.vo.OuterofWxIndexVo;
import com.sixth.bean.vo.WxUserIndexVo;
import com.sixth.service.WxUserService;
import com.sixth.util.MarketInfoUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName WxUserController
 * @Description TODO
 * @Author XiaoWJ
 * @Date 2022/9/10 22:54
 **/
@RestController
@RequestMapping("wx/user")
public class WxUserController {

    @Autowired
    WxUserService wxUserService;


    /**
     * 个人信息主页的订单状态显示
     * @Param
     * @Return BaseRespVo
     * @author XiaoWJ
     * @date   2022/9/10 23:04
     */

    @RequestMapping("index")
    public BaseRespVo index(){
        MarketUser marketUser = MarketInfoUtil.getMarketUser();
        Integer id = marketUser.getId();

        WxUserIndexVo wxUserIndexVo = wxUserService.index(id);

        return BaseRespVo.ok(new OuterofWxIndexVo(wxUserIndexVo));

    }

}
